import React from 'react'
import style from './style.module.scss'
import { useNavigate } from 'react-router-dom'
import { getTimeFormatText } from '../../utils/formatTime'

interface PropsType {
  infoId: string;
  title: string;
  doctor: string;
  createTime: number;
}

export const MyThumbnail: React.FC<PropsType> = ({ infoId, title, doctor, createTime }) => {
  const navigate = useNavigate()

  return (
    <div
      className={style.collectionConent_item}
      key={infoId}
      onClick={() => navigate(`/home/information/${infoId}`)}
    >
      <div className={style.noPicture}>
        <div className={style.title}>{title}</div>
        <div className={style.doctor_createTime}>
          <div>{doctor}</div>
          <div>{getTimeFormatText(new Date(createTime))}</div>
        </div>
      </div>
    </div>
  )

}
